<template>
    <!-- <button @click="$emit('update:num',num+1)">点击 {{ num }}</button> -->
    <button @click="add">点击 {{ num }}</button>
</template>
<script setup>
import {defineProps,defineEmits} from 'vue'

const props = defineProps({
    num:Number
});
function add() {
    emits('update:num',props.num+1);
}

const emits=defineEmits(['update:num']);
</script>